#ifndef _UART_INTERFACE_H
#define _UART_INTERFACE_H

#include "ccm4101_reg.h"
#include "lcduart.h"
#define BUFFER_SIZE    1050


/* 
	D7C0S1: D7:data 7bits; C0:check 0 bit, E0: check even 1 bit, O:check odd 1bit; S1:stop 1bit. 
*/ 
typedef enum
{
	COMM_PROTOCOL_None 	 = 0,
	COMM_PROTOCOL_D7C0S1 = 1,
	COMM_PROTOCOL_D7C0S2,
	COMM_PROTOCOL_D7E1S1,
	COMM_PROTOCOL_D7O1S1,
	COMM_PROTOCOL_D7E1S2,
	COMM_PROTOCOL_D7O1S2,
	COMM_PROTOCOL_D8C0S1,
	COMM_PROTOCOL_D8C0S2,
	COMM_PROTOCOL_D8E1S1,
	COMM_PROTOCOL_D8O1S1,
	COMM_PROTOCOL_D8E1S2,
	COMM_PROTOCOL_D8O1S2,
} UART_COMM_PROTOCOL;



void Uart_Init(UART_TypeDef *puart);
void Uart_Receive(LCDUART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
void UART_GPIOInit(UART_TypeDef  *puart, GPIO_InitTypeDef *GPIO_Init);
GPIO_PinStateTypeDef UART_GPIOReadPin(UART_TypeDef *puart, UART_PinTypeDef Pin);
#endif
